package com.caidan.framework.redis.key;

import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.context.annotation.Conditional;

@Configurable
public class UserProviderCacheKeyBuilder extends RedisKeyBuilder {
    private static String USER_INFO_KEY = "user:info";
    private static String USER_LOGIN_TOKEN_KEY = "user:login:token";

    private static String USER_MESSAGE_TOKEN = "user:message:token";
    public String buildUserLoginTokenKey(String tokenKey) {
        return super.getPrefix() + USER_LOGIN_TOKEN_KEY + super.getSplitItem() + tokenKey;
    }
    public String buildUserInfoKey(Long userId) {
        return super.getPrefix() + USER_INFO_KEY + super.getSplitItem() + userId;
    }
    public String buildUserMessageToken(String token) {
        return super.getPrefix() + USER_MESSAGE_TOKEN + super.getSplitItem() + token;
    }

}